<!-- 自定义导航 -->
<template>
	<view>
		<!-- tabBar首页类型 -->
		<u-navbar v-if="navbarStyle=='home'"  :title="title" :placeholder="true" :bgColor="bgColor" leftIcon=" "
		:titleStyle="{ color: '#FFF' }" ></u-navbar>
		<!-- 自定义带返回首页类型 -->
		<u-navbar v-else-if="navbarStyle=='custom'" :title="title" :autoBack="false" :placeholder="true" :bgColor="bgColor"
		 :titleStyle="{ color: '#FFF' }" >
			<view class="u-nav-slot flex-row solidTab round " slot="left">
				<u-icon name="arrow-left" size="19" color="#fff" @tap="BackPage"></u-icon>
				<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
				<u-icon name="home" size="20" color="#fff" @tap="toHome"></u-icon>
			</view>
		</u-navbar>
		<!-- 正常返回类型 -->
		<u-navbar v-else :title="title" :leftText="leftText" :autoBack="true" :placeholder="true" :bgColor="bgColor"
		 leftIconColor="#FFF" :titleStyle="{ color: '#FFF' }" >
		</u-navbar>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props: {
			bgColor: {
				type: String,
				default: ''
			},
			navbarStyle: {
				type: String,
				default: 'back'
			},
			title: {
				type: String,
				default: ''
			},
			leftText: {
				type: String,
				default: ''
			},
		},
		methods: {
			BackPage(){
				uni.navigateBack({
					delta: 1
				});
			},
			toHome(){
				uni.navigateTo({
					url:'/pages/index/index'
				})
			}
			
		}
	}
</script>

<style>
	.solidTab{
		border: 1rpx #fff solid;
		padding: 10rpx 15rpx;
	}

</style>
